package advance_2;

public class Student implements Comparable<Student> {
    //员工有姓名，年龄，性别，职务，薪水、工号等属性，
    private String name;
    private int age;
    private String sex;
    private String job;
    private double money;
    private String workNumber;

    public Student(String name, int age, String sex, String job, double money, String workNumber) {
        this.name = name;
        this.age = age;
        this.sex = sex;
        this.job = job;
        this.money = money;
        this.workNumber = workNumber;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getJob() {
        return job;
    }

    public void setJob(String job) {
        this.job = job;
    }

    public double getMoney() {
        return money;
    }

    public void setMoney(double money) {
        this.money = money;
    }

    public String getWorkNumber() {
        return workNumber;
    }

    public void setWorkNumber(String workNumber) {
        this.workNumber = workNumber;
    }


    public void showInforSalary() {

        System.out.println("Salary{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", sex='" + sex + '\'' +
                ", job='" + job + '\'' +
                ", money='" + money + '\'' +
                ", workNumber='" + workNumber + '\'' +
                '}');
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", sex='" + sex + '\'' +
                ", job='" + job + '\'' +
                ", money=" + money +
                ", workNumber='" + workNumber + '\'' +
                '}';
    }

    @Override
    public int compareTo(Student o) {
        //定好规则
        //return this.name.compareTo(o.name);
        return (int)(this.money-o.money);
    }
}
